Add some rudimentary tests for discard option.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 11 Jun 2014 02:30:13 +0000 (02:30 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 11 Jun 2014 02:30:13 +0000 (02:30 +0000)
gpsbabel/testo.d/track-discard.test

index e9efad932034aa5fad8cc1b1c389e05400e3bd88..a21c07dc6f3de8490d8d37c8149e240622201fc8 100644 (file)
@@ -15,3 +15,16 @@ compare ${REFERENCE}/track/trackfilter_discard_err.gpx ${TMPDIR}/discard.err
 # ... but should get through if we discard the points.
 gpsbabel -t -i gpx -f ${REFERENCE}/track/trackfilter_discard.gpx -x track,merge,discard -o gpx -F ${TMPDIR}/discard.gpx
 compare ${REFERENCE}/track/trackfilter_discard_out.gpx ${TMPDIR}/discard.gpx
+
+# This file has ONLY names starting with GC; verify we toss all.
+./gpsbabel -i geo -f geocaching.loc  -x discard,matchname=GC* -o csv -F ${TMPDIR}/discardgc.geo
+compare ${TMPDIR}/discardgc.geo /dev/null
+
+# Throw out all caches from Joe
+gpsbabel -i geo -f geocaching.loc  -x discard,matchdesc=JoGPS -o csv -F ${TMPDIR}/discardjoe.csv
+nlines=$(wc -l ${TMPDIR}/discardjoe.csv | awk '{print $1}')
+if [ $nlines -ne 4 ];
+then
+  echo matchdesc failed.
+  exit 1
+fi